<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="jakarta.tags.core" %>
<%@ taglib prefix="fmt" uri="jakarta.tags.fmt" %>

<header class="header">
    <div class="container">
        <div class="logo">
            <a href="/">HiLover</a>
        </div>
        <nav class="nav">
            <a href="/">首页</a>
            <a href="/couples">情侣</a>
            <c:choose>
                <c:when test="${empty sessionScope.loginUser}">
                    <a href="/login">登录</a>
                    <a href="/register">注册</a>
                </c:when>
                <c:otherwise>
                    <a href="/user/profile">我的主页</a>
                    <c:if test="${sessionScope.loginUser.role == 1}">
                        <a href="/admin">后台管理</a>
                    </c:if>
                    <a href="/logout">退出登录</a>
                </c:otherwise>
            </c:choose>
        </nav>
        <div class="search">
            <form action="/couples/search" method="get">
                <input type="text" name="keyword" placeholder="搜索情侣...">
                <button type="submit">搜索</button>
            </form>
        </div>
    </div>
</header> 